package com.treasure.mall.biz.repository.user;

import com.treasure.mall.biz.base.JpaSearchableRepository;
import com.treasure.mall.biz.entity.user.UserFollowPO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

@Repository
public interface UserFollowRepository extends JpaSearchableRepository<UserFollowPO, Long> {
    UserFollowPO findByUserPO_UserIdAndFollow_UserId(Long userId, Long blogger);

    Page<UserFollowPO> findByUserPO_UserId(Long userId, Pageable pageable);

    Page<UserFollowPO> findByFollow_UserId(Long userId, Pageable pageable);

    long countByUserPO_UserId(Long userId);

    long countByFollow_UserId(Long userId);

    boolean existsByUserPO_UserIdAndFollow_UserId(Long userId, Long follow);
}
